using MicroMsg.Network;
using System;
namespace MicroMsg.Scene.Voice
{
	public class DownloadVoiceContextMgr : ContextMgrBase<DownloadVoiceContext>
	{
		private const string TAG = "DownloadVoiceContextMgr";
		public static DownloadVoiceContextMgr gDownloadVoiceContextMgr;
		public static DownloadVoiceContextMgr getInstance()
		{
			if (DownloadVoiceContextMgr.gDownloadVoiceContextMgr == null)
			{
				DownloadVoiceContextMgr.gDownloadVoiceContextMgr = new DownloadVoiceContextMgr();
			}
			return DownloadVoiceContextMgr.gDownloadVoiceContextMgr;
		}
		public DownloadVoiceContext GetBySvrID(int svrID)
		{
			DownloadVoiceContext result;
			lock (this.mQueueLock)
			{
				if (this.mContextQueue.isEmpty())
				{
					result = null;
				}
				else
				{
					for (ListNode next = this.mContextQueue._head._next; next != null; next = next._next)
					{
						DownloadVoiceContext downloadVoiceContext = (DownloadVoiceContext)next._obj;
						if (downloadVoiceContext != null && downloadVoiceContext.mMsgSvrID == svrID)
						{
							result = downloadVoiceContext;
							return result;
						}
					}
					result = null;
				}
			}
			return result;
		}
	}
}
